package excercise;

public class chwgigs3 {

	
	public static void main(String[] args) {
	  
	  Family f=new me(); 
	  Family f2=new mother(); 
	  Family f3=new sister(); 
	  
	  f.say();                   // up casting
	  f2.say();
	  f3.say();
	  
	  f.say((me)f);             //down casting
	  f2.say((mother)f2);
	  f3.say((sister)f3);
	  

	}//

}//
  class Family{
	  public void say(){
		  System.out.println("we are family");
	  }
	  public void say(me m){
		  System.out.println("hee");
	  }
	  public void say(mother m){
		  System.out.println("mom");
	  }
	  public void say(sister s){
		  System.out.println("sister");
	  }
  }// 
  class me extends Family{}
  
  class sister extends Family{}
  
  class mother extends Family{}
	  
  

 